package com.ctshk.rpc.localfun.service;

import com.ctshk.common.dto.Result;
import com.ctshk.common.model.TokenUser;
import com.ctshk.rpc.localfun.dto.LocalFunPriceDTO;
import com.ctshk.rpc.localfun.dto.LocalFunProductDetailsResDTO;
import com.ctshk.rpc.localfun.dto.LocalFunStockInfo;
import com.ctshk.rpc.localfun.dto.es.*;
import com.ctshk.rpc.localfun.req.*;
import com.ctshk.rpc.localfun.req.cache.LocalFunOrderReq;
import com.ctshk.rpc.localfun.req.cache.LocalFunProductCacheOpsReq;
import com.ctshk.rpc.localfun.req.cache.RemainderNumOpsReq;

import java.math.BigDecimal;
import java.util.List;

/**
 * @Description
 * @Author wansi <gaylen15527491065@yeah.net>
 * @Date 2021/4/12
 */
public interface ILocalFunAppProductService {

    /**
     * 根據查詢條件查詢產品列表
     *
     * @param req
     * @return
     */
    Result<LocalFunHomeDto> queryProductList(PCLocalFunQueryReq req);

    /**
     * 缓存初始化
     *
     * @return
     */
    Result cacheInit();

    /**
     * 查询产品详情列表
     *
     * @param req
     * @return
     */
    Result<LocalFunProductDetailsResDTO> queryProductDetails(LocalFunProductDetailsQueryReq req);

    /**
     * 查询产品信息
     *
     * @param id
     * @return
     */
    BigDecimal queryProducFee(Long id, BigDecimal price);

    /**
     * 缓存更新
     *
     * @return
     */
    Result cacheUpdate(LocalFunProductCacheOpsReq req);


    /**
     * 删除缓存
     * @param req
     * @return
     */
    Result deleteCache(LocalFunProductCacheOpsReq req);
    /**
     * 剩余票数操作
     *
     * @param req
     * @return
     */
    Result remainderNumberOps(RemainderNumOpsReq req);

    /**
     * 订单支付详情列表
     * @param queryNumber
     * @return
     */
    Result payDetails(String queryNumber, TokenUser tokenUser);


    /**
     * 获取产品单价价格
     * @param req
     * @return
     */
    Result<LocalFunPriceDTO> getPrice(LocalFunPriceReq req);

    /**
     * 获取核对订单页面信息
     * @param localFunOrderReq
     * @param currentUserAllowNotLogInUserId
     * @return
     */
    Result<LocalFunReservationGetOrderDTO> getOrderInfo(LocalFunOrderReq localFunOrderReq, Long currentUserAllowNotLogInUserId);

    /**
     * 搜索类别
     * @param req
     * @return
     */
    Result<LocalFunSearchDTO> queryKindProduct(PCLocalFunQueryReq req);

    /**
     * 首页入口列表
     * @param req
     * @return
     */
    Result<List<LocalFunHomeTitleDTo>> getHomeTitleList(PCLocalFunQueryReq req);

    /**
     * 是否有余票
     * @param productId
     * @param attrId1 规格ID1
     * @param attrId2 规格ID2
     * @param strategyType 1：自营；2：代理；3：官方平台；4：第三方平台；
     * @param relId
     * @return
     */
    boolean noMoreSurplusNumber(Long productId,Long attrId1,Long attrId2,Integer strategyType,Long relId);

    /**
     * 获取规格信息
     * @param attrId1
     * @param attrId2
     * @return
     */
    LocalFunStockInfo getCostTouristStockInfo(Long attrId1, Long attrId2);

    /**
     * 获取热门推荐接口
     * @return
     * @param req
     */
    Result<List<HotLocalFunDto>> getHotRecommends(PCLocalFunQueryReq req);
}
